package cn.huaqingcheng.tianshu.infrastructure.uc.entity;

import cn.huaqingcheng.tianshu.common.core.model.AttributeMap;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 账号KV存储
 */
@Data
@NoArgsConstructor
@TableName("account_kv")
public class AccountKeyValueEntity {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 账号ID
     */
    @TableField("account_id")
    private Long accountId;

    /**
     * 键
     */
    @TableField("\"key\"")
    private String key;

    /**
     * 值
     */
    @TableField("\"value\"")
    private AttributeMap<Object> value;

    @Version
    @TableField("version")
    private Integer version;

    @TableField("created_at")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    private LocalDateTime updatedAt;

}
